
package com.ryskoo.customer.customer.domain;

import com.ryskoo.customer.customeraccount.domain.CustomerAccountPO;
import com.ryskoo.framework.core.bean.BasicPO;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @author xman
 */
@Entity
@Table(name = "CUS_CUSTOMER")
public class CustomerPO extends BasicPO {

	private static final long serialVersionUID = 3391136354050580429L;

	/** 登录账号 */
	@Column(name = "login_name", length = 30)
	private String loginName;

	/** 登录密码 */
	@Column(name = "password", length = 50)
	private String password;

	/** 手机号 */
	@Column(name = "mobile", length = 14)
	private String mobile;

	/** 注册来源：1.PC注册 2.H5注册 3.APP注册 4.小程序注册 5.后台添加 */
	@Column(name = "source", columnDefinition = "tinyint")
	private String source;

	/** 账号状态：1激活 2冻结 */
	@Column(name = "active_state", columnDefinition = "tinyint")
	private String activeState;

	/** 邀请人 */
	@Column(name = "inviter_uuid", columnDefinition = "char(32)", length = 32)
	private String inviterUuid;

	/**
	 * 邀请人昵称
	 */
	@Transient
	private String inviterName;

	/** 邀请人 */
	@Column(name = "vendor_id", columnDefinition = "char(32)", length = 32)
	private String vendorId;

	/** 支付宝第三方登录码 */
	@Column(name = "alipay_code", length = 50)
	private String alipayCode;

	/** 微信 openid 公众号 */
	@Column(name = "openid", columnDefinition = "char(32)", length = 32)
	private String openid;

	/** 微信 openid 小程序 */
	@Column(name = "openid_app", columnDefinition = "char(32)", length = 32)
	private String openidApp;

	/** 微信 openid 开放平台 */
	@Column(name = "openid_open", columnDefinition = "char(32)", length = 32)
	private String openidOpen;

	/** 微信登录 unionid */
	@Column(name = "unionid", columnDefinition = "char(32)", length = 32)
	private String unionid;

	/** 微博第三方登录码 */
	@Column(name = "weibo_code", length = 50)
	private String weiboCode;

	/** QQ第三方登录码 */
	@Column(name = "qq_code", length = 50)
	private String qqCode;

	/** 会员数据信息 */
	@Transient
	private CustomerAccountPO customerAccount;

	/** 是否发送短信通知 */
	@Transient
	private boolean sendMessage = false;

	/** 是否重置密码 */
	@Transient
	private boolean resetPassword = false;

	public boolean isSendMessage() {
		return sendMessage;
	}

	public void setSendMessage(boolean sendMessage) {
		this.sendMessage = sendMessage;
	}

	public boolean isResetPassword() {
		return resetPassword;
	}

	public void setResetPassword(boolean resetPassword) {
		this.resetPassword = resetPassword;
	}

	public CustomerAccountPO getCustomerAccount() {
		return customerAccount;
	}

	public void setCustomerAccount(CustomerAccountPO customerAccount) {
		this.customerAccount = customerAccount;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getActiveState() {
		return activeState;
	}

	public void setActiveState(String activeState) {
		this.activeState = activeState;
	}

	public String getInviterUuid() {
		return inviterUuid;
	}

	public void setInviterUuid(String inviterUuid) {
		this.inviterUuid = inviterUuid;
	}

	public String getAlipayCode() {
		return alipayCode;
	}

	public void setAlipayCode(String alipayCode) {
		this.alipayCode = alipayCode;
	}

	public String getVendorId() {
		return vendorId;
	}

	public void setVendorId(String vendorId) {
		this.vendorId = vendorId;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getOpenidApp() {
		return openidApp;
	}

	public void setOpenidApp(String openidApp) {
		this.openidApp = openidApp;
	}

	public String getOpenidOpen() {
		return openidOpen;
	}

	public void setOpenidOpen(String openidOpen) {
		this.openidOpen = openidOpen;
	}

	public String getUnionid() {
		return unionid;
	}

	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}

	public String getWeiboCode() {
		return weiboCode;
	}

	public void setWeiboCode(String weiboCode) {
		this.weiboCode = weiboCode;
	}

	public String getQqCode() {
		return qqCode;
	}

	public void setQqCode(String qqCode) {
		this.qqCode = qqCode;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getInviterName() {
		return inviterName;
	}

	public void setInviterName(String inviterName) {
		this.inviterName = inviterName;
	}

	@Override
    public String toString() {
        return "CustomerPO{" +
                "loginName='" + loginName + '\'' +
                ", password='" + password + '\'' +
                ", mobile='" + mobile + '\'' +
                ", source='" + source + '\'' +
                ", activeState='" + activeState + '\'' +
                ", inviterUuid='" + inviterUuid + '\'' +
				", inviterName='" + inviterName + '\'' +
                ", vendorId='" + vendorId + '\'' +
                ", alipayCode='" + alipayCode + '\'' +
                ", openid='" + openid + '\'' +
                ", openidApp='" + openidApp + '\'' +
                ", openidOpen='" + openidOpen + '\'' +
                ", unionid='" + unionid + '\'' +
                ", weiboCode='" + weiboCode + '\'' +
                ", qqCode='" + qqCode + '\'' +
                ", customerAccount=" + customerAccount +
                ", sendMessage=" + sendMessage +
                ", resetPassword=" + resetPassword +
                "} " + super.toString();
    }
}
